//
//  DetailVC.swift
//  SelfGoodAsOldPhomes
//
//  Created by panda on 17/3/14.
//  Copyright © 2017年 panda. All rights reserved.
//

import UIKit

class DetailVC: UIViewController {

    var model : TableViewModel?
    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
        let btn = UIButton.init(type: UIButtonType.custom);
        btn.frame = CGRect(x: 0, y: 0, width: 60, height: 30)
        btn.setTitle("返回", for: UIControlState.normal);
        btn.setTitleColor(UIColor.black, for: UIControlState.normal)
        btn.addTarget(self, action: #selector(goBack), for: UIControlEvents.touchUpInside)
        let leftBar = UIBarButtonItem(customView: btn) //action: #selector(goBack))
        navigationItem.leftBarButtonItem = leftBar;
        
        view.addSubview(imgV);
        
        imgV.image = UIImage(named: (model?.imgStr)!)
        
    }

    fileprivate lazy var imgV : UIImageView = {
        let img = UIImageView.init(frame: CGRect(x: 0, y: 64, width: 375, height: UIScreen.main.bounds.height - 64));
        return img
    }()
    
    func goBack() {
        let _ = self.navigationController?.popViewController(animated: true)
    }
    
    
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
